What's new in Go 1.19
Go 1.18 was a major release where we saw the introduction of generics into the language as well as other notables such as fuzzing and workspaces. With Go 1.19 slated to come out next month, one has to wonder what’s next. Are we in store to be blown away by new and major features like we saw in 1.18? Not exactly but there are still lots of improvements to be on the lookout for.
Joining Mat & Johnny to touch on some of the most interesting ones is Carl Johnson, himself a contributor to the 1.19 release.
Matched from the episode's transcript 👇
Carl Johnson: It’s like, we’re going to allocate a gigabyte that we don’t need, just for good luck. But basically, what that did was it sort of tricked the garbage collector into thinking that, “Oh, well, you’ve allocated 300 megabytes of new memory, but you still have that giant two gigabytes slab that you’re not really using, so I’m not going to trigger for another little bit.”
So it was just a kind of funny way of tricking the garbage collector into triggering at different times. But I think with the soft memory limit now, that should hopefully be obsolete, because it was definitely– it’s one of those hacks where it’s like, it’s genius and it’s idiocy at the same time. You’re like, “I can’t believe somebody thought of something this clever”, and also, “I can’t believe somebody thought of something this stupid.”